<template>
	<view class="yaoyue">
		<scroll-view style="height: 100%;" ref="scrollview" scroll-y="true" @scrolltolower="scrolltolower" refresher-enabled>
			<view class="item" v-for="(item,index) in list" :key="index">
				<div class="yaoyue1">
					<image class="img" :src="item.avatarUrl" mode="" mode="aspectFill"></image>
					<div class="name">{{ item.personName }}</div>
					<div class="position">{{ item.companyName }}·{{ item['positionValue' + En] }}</div>
					<div class="right">{{ item.startTime }}</div>
				</div>
				<div class="yaoyue2">
					{{ item.theme }}
				</div>
				<div class="yaoyue3">
					<image class="icon" src="https://static.inclusionconf.com/static/images/chat/addr-icon.png" mode="" mode="aspectFill"></image>
					<div class="span">{{ item['meetingAddressValue' + En] }}</div>
				</div>
				<div class="yaoyue3">
					<image class="icon" src="https://static.inclusionconf.com/static/images/chat/time-icon.png" mode="" mode="aspectFill"></image>
					<div class="span">{{ item['meetingDateValue' + En] }} {{ item.startTime }}-{{ item.endTime }}</div>
				</div>
				<div class="btns">
					<div class="btn" @click="rejectHuimian(item.uuid, getData)">拒绝</div>
					<div class="btn on" @click="acceptHuimian(item.uuid, getData)">接受</div>
				</div>
			</view>
			<view style="height: 100rpx;"></view>
		</scroll-view>
	</view>
</template>

<script>
	import protal from "@/api/protal"
	
	export default {
		data() {
			return {
				pageNum: 1,
				list: [],
				total: 0
			}
		},
		created() {
			this.pageNum = 1
			this.getData()
		},
		methods: {
			getData() {
				const params = {
					pageNum: this.pageNum,
					pageSize: 30
				}
				protal.offlinemeetinglist(params).then(res => {
					this.loading = false
					if (res.code === '0000') {
						this.total = res.total
						if (this.pageNum == 1) {
							this.list = res.data
						} else {
							this.list = [...this.list, ...res.data]
						}
					}
				}).catch(err => {
					this.loading = false
				})
			},
			scrolltolower() {
				if (this.total && this.total > this.list.length && !this.loading) {
					this.pageNum++
					this.loading = true
					this.getData()
				}
			},
		},
	}
</script>

<style lang="scss" scoped>
	.yaoyue {
		height: 100%;
		padding-top: 12px;
		padding-bottom: 100rpx;
		overflow: hidden;
		background-color: #F0F1FB;
		
		.item {
			width: 694rpx;
			height: 184px;
			margin: 0 auto 6px;
			overflow: hidden;
			position: relative;
			border-radius: 10px;
			background-color: #fff;
			
			.yaoyue1 {
				position: relative;
				padding-top: 10px;
				padding-left: 52px;
				padding-right: 10px;
				height: 54px;
				box-sizing: border-box;
				border-bottom: 1px solid rgba(138, 142, 153, 0.30);
				
				.img {
					position: absolute;
					left: 14px;
					top: 10px;
					width: 34px;
					height: 34px;
					border-radius: 6px;
				}
				
				.name {
					font-family: AlibabaPuHuiTi_3_75_SemiBold;
					font-size: 13px;
					color: #0A0F1A;
					line-height: 14px;
					text-align: left;
					font-style: normal;
					margin-top: 2px;
				}
				
				.position {
					margin-top: 3px;
					font-family: AlibabaPuHuiTi_3_55_Regular;
					font-size: 11px;
					color: #0A0F1A;
					line-height: 14px;
					text-align: left;
					font-style: normal;
				}
				
				.right {
					position: absolute;
					right: 16px;
					top: 50%;
					transform: translateY(-50%);
					font-family: AlibabaPuHuiTi_3_55_Regular;
					font-size: 12px;
					color: #0A0F1A;
					line-height: 14px;
					text-align: left;
					font-style: normal;
				}
			}
			
			.yaoyue2 {
				padding: 12px 14px 0;
				height: 52px;
				box-sizing: border-box;
				font-family: AlibabaPuHuiTi_3_65_Medium;
				font-size: 16px;
				color: #0A0F1A;
				line-height: 24px;
				text-align: left;
				font-style: normal;
			}
			
			.yaoyue3 {
				display: flex;
				align-items: center;
				margin-bottom: 8px;
				padding-left: 14px;
				
				.icon {
					width: 12px;
					height: 12px;
					margin-right: 2px;
				}
				
				.span {
					font-family: AlibabaPuHuiTi_3_45_Light;
					font-size: 12px;
					color: #000000;
					line-height: 14px;
					text-align: left;
					font-style: normal;
				}
			}
			
			.btns {
				position: absolute;
				right: 17px;
				bottom: 10px;
				display: flex;
				
				.btn {
					padding: 0 18px;
					height: 28px;
					background: rgba(30,35,75,0.1);
					border-radius: 14px;
					font-family: AlibabaPuHuiTi_3_65_Medium;
					font-size: 12px;
					color: #1E234B;
					line-height: 1;
					display: flex;
					align-items: center;
					justify-content: center;
					font-style: normal;
					margin-left: 8px;
					
					&.on {
						background-color: rgba(115, 80, 245, 1);
						color: #fff;
					}
				}
			}
		}
	}
</style>